use threads;
$| = 1;
$thr = threads->new(\&sub1);
print "in the  main thread\n";
$thr->join();
sub sub1
{
    print "In the thread\n"    for(1..1000);
}
